#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    char kthCharacter(long long k, vector<int>& operations) {
        long long res = 0;
        int i = 0;
        --k;
        while (k)
        {
            if (operations[i++] == 1 && (k & 1) == 1)
                ++res;
            k >>= 1;
        }
        return 'a' + (res % 26);
    }
};